package cn.schoolwow.quickflow.test.module.business.dataRange.tryCatchFinally;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.listener.TryCatchFinallyHandler;
import org.junit.Assert;

public class SecondTryCatchFinally implements TryCatchFinallyHandler {
    @Override
    public void handleTryStart(FlowContext flowContext) throws Exception {
        flowContext.putData("流程数据", "123");
    }

    @Override
    public void handleTryEnd(FlowContext flowContext) throws Exception {

    }

    @Override
    public void handleException(FlowContext flowContext, Exception e) {

    }

    @Override
    public void handleFinally(FlowContext flowContext) {
        String data = flowContext.checkData("流程数据", String.class);
        Assert.assertEquals("123", data);
    }

    @Override
    public String name() {
        return "第二个流程处理器";
    }
}
